<?php
/********************************************************
** Copyright 2010-2013. Todos los derechos reservados. **
** Desarrollado y Gestionado por:					   **
** Sugey Quintero (Analista)						   **
** José G. De Freitas (Programador)					   **
** Klaudia Uribe (Diseñadora Web)					   **
** Cesar Isturiz (Diseñador Web)					   **
**				S E A  v1.0							   **
*********************************************************/

require_once("conexion.php");
session_start();

if (isset($_SESSION['name']) and isset($_SESSION['tiempo']) and ($_SESSION['status']==1)) {
        include("Tiempo.php");
	date_default_timezone_set('America/Caracas'); setlocale(LC_TIME, 'spanish');
	$usuario = $_SESSION['name'];
	$fecha = date("Y-m-d H:i:s");
	$auditoria = mysql_query("INSERT INTO auditoria SELECT '$usuario', '$fecha' , 'Inicio Sistema Escuela' ");

}else if($_SESSION["status"] == 0){
		echo "<script>alert('Usuario bloqueado. Por favor comuniquese con el administrador para resolver el problema.');</script>";
		echo "<script>document.location.href='salir.php';</script>";
}else {
		echo "<script>alert('Debe ingresar al sistema primero');</script>";
		echo "<script>document.location.href='index.php';</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Inicio Sistema Escuela</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<link href="style.css" rel="stylesheet" type="text/css" />
<!-- calendario-->
<link rel="stylesheet" type="text/css" href="src/css/jscal2.css">
<link rel="stylesheet" type="text/css" href="src/css/border-radius.css">
<link rel="stylesheet" type="text/css" href="src/css/steel/steel.css">
<script type="text/javascript" src="src/js/jscal2.js"></script>
<script type="text/javascript" src="src/js/lang/es.js"></script>
<!-- fin calendario-->
<!-- botones-->
<link type="text/css" href="js/css/smoothness/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />      
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script> 
<script>
var j$ = jQuery.noConflict();
j$(document).ready(function(){
j$(".button").button();
});

j$(function(){
	j$('#menu li a').click(function(event){
		var elem = j$(this).next();
		if(elem.is('ul')){
			event.preventDefault();
			j$('#menu ul:visible').not(elem).slideUp();
			elem.slideToggle();
		}
	});
});
</script>
<!-- fin botones-->
</head>

<body>
<div id="wrap">
<div id="header">
<div id="hora">
<?php include("Hora.php"); ?>
</div>
<div id="topnav">
	<?php include("MenuSuperior.php"); ?>
</div>

           

</div>
<div id="content">
<div id="left">
<div class="post">
<div class="post_h">

</div>

<div class="postcontent">

<blockquote><h2 align="center">NOTICIAS</h2></blockquote>

	<fieldset>
		<legend align=left><b><font size=2>HOY</font></b></legend>
			<?php date_default_timezone_set('America/Caracas'); setlocale(LC_TIME, 'spanish'); $dia=date(d); $mes=date(m);
				$cumple = mysql_query("SELECT Nombres, Apellidos FROM personal WHERE MONTH(F_nac)='$mes' AND DAY(F_nac)='$dia'");
					if(mysql_num_rows($cumple)<=0){
						echo "<p align=center><br><font face='Times New Roman, Times, serif' size=5 color=#007993>Hoy no hay cumplea&ntilde;os</font></p>";
					}else {
						echo "<p align=center><br><font face='Times New Roman, Times, serif' size=5 color=#007993>Hoy est&aacute; de cumplea&ntilde;os</font></p> ";
							while($rw=mysql_fetch_array($cumple)){
								echo "<p align=center><br><font face='Times New Roman, Times, serif' size=5 color=#007993><b>* $rw[0] $rw[1]</b></font></p>";
							}
						echo "<p align=center><img src='images/felicidades.jpg' width=300 height=150></p>";
					} ?>
	</fieldset>
	
<div class="post">
<span></span></div>	

	<fieldset>
		<legend align=left><b><font size=2><?php date_default_timezone_set('America/Caracas'); setlocale(LC_TIME, 'spanish'); echo ucwords(strtoupper(strftime("MES DE %B"))); ?></font></b></legend>
			<table width=100% cellspacing=5 cellpadding=3 border=0>
				<tr>
					<th>Cumplea&ntilde;os (d&iacute;a)</th><th>Nombres</th><th>Apellidos</th>
				</tr>
				<?php $sql = mysql_query("SELECT F_nac, Nombres, Apellidos FROM personal WHERE MONTH(F_nac)=".date(m)." ORDER BY F_nac");
						while($row=mysql_fetch_array($sql)){ ?>
				<tr>
					<td align=center width=30%><?php $fecha= explode("-", $row[0]); echo $fecha[2]; /*$fecha[0]=date('d', strtotime($row[0]));*/ ?></td><td align=center><?php echo $row[1]; ?></td><td align=center><?php echo $row[2]; ?></td>
				</tr>
				<?php } ?>
			</table>
	</fieldset>

</div>
<div class="post_b">
<span></span></div>
</div>

<div class="post_b">
<span></span></div>
</div>

<div class="post">
<div class="post_h">

</div>
</div>
<div name="login">

	<?php include("Menu.php"); ?>
	
</div>

<div class="clear"></div>
</div>
<div id="pagebottom"></div>

<div id="footer">
<P>&reg; Derechos Reservados @ CopyRight. 2011-2012</P>
<p>Programadores: Quintero E, Isturiz C, Uribe C, De Freitas J.</p>
</div>
</div>
</body>
</html>
